package xddq

import (
	"fmt"
	"time"
	D "websocket_apn/define"
	"websocket_apn/log"
	"websocket_apn/proto"
)

// 处理仙宫信息
func (xd *XdDriver) CheckXianGongInfoData(allInfo D.XianGongInfo) {
	if allInfo.NeedAppreciate {
		log.Debugf("仙宫-仙宫赞赏")
		xd.Send(proto.Get_Cmd_Data(xd.userInfo.PlayerId, proto.S_PALACE_WORSHIP, "08 00 10 01"))
	}
	for _, Id := range allInfo.Id {
		log.Debugf("仙宫-仙宫点赞%s", Id)
		xd.Send(proto.Get_Cmd_Data(xd.userInfo.PlayerId, proto.S_PALACE_WORSHIP, fmt.Sprintf("08 %s 10 00", Id)))
		time.Sleep(1 * time.Second)
	}
}
